frame: Fix xalign handling
authorMatthias Clasen <mclasen@redhat.com>
Sun, 3 May 2020 15:41:57 +0000 (11:41 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 4 May 2020 11:37:31 +0000 (07:37 -0400)
SEtting a nonzero xalign on frames had no
effect, since we were always using the full
allocation with here, instead of what the label
needs. Found by using testframe for a second.

gtk/gtkframe.c

index 6381e6974d9e4701507fe6ee69e2f4de656daa29..8a1c79a341cd0bfde044e0fa4ea51312f48037b9 100644 (file)
@@ -517,7 +517,7 @@ gtk_frame_size_allocate (GtkWidget *widget,
       gtk_widget_measure (priv->label_widget, GTK_ORIENTATION_VERTICAL, width,
                           &label_height, NULL, NULL, NULL);
 
-      label_allocation.x = new_allocation.x + (new_allocation.width - width) * xalign;
+      label_allocation.x = new_allocation.x + (new_allocation.width - label_width) * xalign;
       label_allocation.y = new_allocation.y - label_height;
       label_allocation.height = label_height;
       label_allocation.width = label_width;